package com.eastidea.live.service;

import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;

import com.eastidea.live.dao.FieldDao;
import com.eastidea.live.dao.FormDao;
import com.eastidea.live.entity.FrmUiField;

@Service
public class FieldServiceImpl implements FieldService {

	@Resource
	FieldDao fieldDao;

	@Override
	public FrmUiField getFieldByUid(String uid) {
		DetachedCriteria dc = DetachedCriteria.forClass(FrmUiField.class);
		dc.add(Restrictions.eq("uid", uid));		
		List<FrmUiField> ls = fieldDao.findByCriteria(dc);
		if (ls.size() > 0) {
			return ls.get(0);
		}
		return null;
	}
	
}
